﻿@model WebBanHang.ViewModel.SanPhamViewModel

@{
    ViewBag.Title = "Thêm Sản Phẩm";    
}

@using (Html.BeginForm("Create", "SanPham", FormMethod.Post, new { enctype = "multipart/form-data", id = "id-form" }))
{    
    @Html.ValidationSummary(true)
    <div class="span-14">
        <div class="div_editor">
            <div class="span-3">
                @Html.LabelFor(model => model.SanPham.NhaCungCap)
            </div>
            <div>
                @Html.TextBoxFor(model => model.SanPham.NhaCungCap, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.SanPham.NhaCungCap)
            </div>
        </div>
        <div class="div_editor">
            <div class="span-3">
                @Html.LabelFor(model => model.SanPham.TenSanPham)
            </div>
            <div>
                @Html.TextBoxFor(model => model.SanPham.TenSanPham, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.SanPham.TenSanPham)
            </div>
        </div>

        <div class="div_editor">
            <div class="span-3">
                @Html.LabelFor(model => model.SanPham.HinhAnh)
            </div>
            <div>
                @Html.TextBoxFor(model => model.SanPham.File, new { @class = "file_1", type = "file" })
                @*<input type="file" class = "file_1" id="file"/>*@
                @Html.ValidationMessageFor(model => model.SanPham.TenSanPham)
            </div>
        </div>
    </div>
    
    <div class="span-14">
        <div class="div_editor">
            <div class="span-3">
                @Html.LabelFor(model => model.SanPham.SoLuong)
            </div>
            <div>
                @Html.TextBoxFor(model => model.SanPham.SoLuong, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.SanPham.SoLuong)
            </div>
        </div>

        <div class="div_editor">
            <div class="span-3">
                @Html.LabelFor(model => model.SanPham.Gia)
            </div>
            <div>
                @Html.TextBoxFor(model => model.SanPham.Gia, new { @class = "inp-form"})
                @Html.ValidationMessageFor(model => model.SanPham.Gia)
            </div>
        </div>

        <div class="div_editor">
            <div class="span-3">
                @Html.LabelFor(model => model.SanPham.NhomSanPhamId)
            </div>
            <div>
                @Html.DropDownListFor(model => model.SanPham.NhomSanPhamId, Model.NhomSanPhamList, new { id = "combobox" })
                @Html.ValidationMessageFor(model => model.SanPham.NhomSanPhamId)
            </div>
        </div>
    </div>

    <div class="clearfix"></div>
    <div class="full div_editor">
        <ul class="tabs" data-persist="true">
            <li><a href="#view1">Giới thiệu</a></li>
            <li><a href="#view2">Tính năng</a></li>
        </ul>
        <div class="tabcontents">
            <div class="fix_tynymce">
                <div id="view1">
                    @Html.TextAreaFor(model => model.SanPham.GioiThieu, new { @class= "texteditor"})
                    @Html.ValidationMessageFor(model => model.SanPham.GioiThieu)
                </div>
                <div id="view2">
                    @Html.TextAreaFor(model => model.SanPham.TinhNang, new { @class= "texteditor"})
                    @Html.ValidationMessageFor(model => model.SanPham.TinhNang)
                </div>
            </div>
        </div>
    </div>
    <p>
        <input type="submit" value="Lưu" class="button"/>
    </p>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Plugin/tabcontent/tabcontent.js" type="text/javascript"></script>
    <link href="~/Plugin/tabcontent/template1/tabcontent.css" rel="stylesheet" type="text/css" />
    <!-- Place inside the <head> of your HTML -->
    <script type="text/javascript" src="~/Plugin/tinymce/tinymce.min.js"></script>
    <script type="text/javascript" src="~/Scripts/tinymce.config.js"></script>
}
